#ifndef _DATA_POINTER_H_
#define _DATA_POINTER_H_

#include "../bytepointer/BytePointer.h"
#include "../bitpointer/BitPointer.h"

/*
	class : DataPointer
	desc : This is similar to the other pointer
	       classes but doesn't care about the 
	       type of data it is operating on it
	       just converts it to a BytePointer interface.
	       Realistically this should be used for types
	       where the type is a packed struct where the 
		the data is known completely or a type that
		is not the size of a byte but needs you want
		to read it like a byte or a bit at a time.
*/

class DataPointer
{
	private:
		//the data to be read or the starting address of said data.
		void* data;
		//the size of the data pointed to.
		unsigned long int length;
	public:
		//default constructor
		DataPointer();
		//sets the data to void* passed in.
		DataPointer(void* d, unsigned long int size);
		//sets the data to void* passed in
		DataPointer(volatile void* d, unsigned long int size);
		//sets the data to void* passed in
		void setData(void* d, unsigned long int size);
		//sets the data to void* passed in
		void setData(volatile void* d, unsigned long int size);
		//returns the sizeof data. Depends on compiler 
		//assuming it returns number of bytes in data.
		unsigned int size();
		//gets a byte pointer to the data at index i.
		BytePointer getByte(unsigned long int byte);
		//simple to use interface for getByte
		BytePointer operator[](unsigned long int byte);
		//used to show equality ..
		bool operator==(void* pointer);
		//used for equality
		bool operator==(DataPointer& pointer);


		
};


#endif



